import {IDiscountStrategy} from './Discount';

export default class MovieTicketContext{
  private price:number = 100;
  private discount:IDiscountStrategy;
  setDiscount(discount:IDiscountStrategy){
    this.discount = discount;
  }

  getPrice():string{
    let price:string = this.discount.calculate(this.price);
    console.log(`最终票价：${price}元`);
    return price;
  }
}